/**
 * Created by Arnald on 2017/5/10.
 */
let msg = require('../util/msg.js');
let util = require('../util/util.js');
let arena = require('./arena.js');

module.exports = action;

function action(obj, cid) {
    if (!obj.userId) {
        msg.send(cid, obj.uuid, 'error', {'api': obj.action, 'code': 10018});
        return false;
    }
    let data = obj.data;
    switch (obj.action) {
        case 'arenaEnter':
            arena.enter(obj, cid, data);
            break;
        case 'rpcInGame':
            arena.rpcInGame(obj, cid, data);
            break;
    }
}